package com.Snake;

import java.util.Random;

/**
 * @create 2022-03-2022/3/19-14:31
 */
public class Food {
   private   int x;
   private   int y;
   private   Random random = new Random();

   Food(){
        init();
   }
    public void init(){
          x=20+20*random.nextInt(30);
          y=20+20*random.nextInt(30);

     }

     public int getX() {
          return x;
     }

     public void setX(int x) {
          this.x = x;
     }

     public int getY() {
          return y;
     }

     public void setY(int y) {
          this.y = y;
     }
}
